<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script type="module">
    // import {
    //     createRenderer,
    //     render,
    //     Fragment,
    //     h
    // } from '/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.js'
    // import {
    //     createRenderer,
    //     render,
    //     h
    // } from '/node_modules/@vue/runtime-dom/dist/runtime-dom.esm-browser.prod.js'
    import {
        // renderOptions,
        h,
        render,
        Fragment,
        Text
    } from "./runtime-dom.js"

    const renderComponent = {
        setup(props, { emit }) {
            return () => h("button", {
                onclick: () => {
                    console.log(111);

                    emit('myEvent', 100,)
                }
            }, '点我')
        }
    }



    // 给组件绑定事件 <div @myEvent> 会转为大写 onMyEvent
    //  vnode.type.props
    render(h(renderComponent, {
        onMyEvent: (val) => {
            alert(val)
        }
    }), document.body)
    setTimeout(() => {
        render(null, document.body)
    }, 2000)
</script>

</html>